<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title></title>
	<link rel="stylesheet" href="${staticServer}/inc/style/main.css"/>
	<link rel="stylesheet" href="${staticServer}/inc/style/page.css"/>
	<link rel="stylesheet" href="${staticServer}/css/consultant_client.css"/>
	<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
	<link rel="stylesheet" href="${staticServer}/common/uploadify/css/upload.css?1.3" type="text/css">
	<script src="${staticServer}/inc/js/jquery.js"></script>
	<script src="${staticServer}/inc/js/pageset.js"></script>
	<script src="${staticServer}/inc/js/datepicker.js"></script>
	<script src="${staticServer}/js/web/system_reserve_stat.js?1.0"></script>
	<script type="text/javascript" src="${staticServer}/common/uploadify/jquery.uploadify.js"></script>
	<script type="text/javascript" src="${staticServer}/js/web/uploadImg.js?1.8"></script>
	
	<script>
		$(function(){
			var flag = '${flag}';
			var type = '${type}';
			if(flag != "" && type != ""){
				alert("上传成功，一共上传 ${flag} 条数据！");
				//市场部资源
				if(type == "ct5yq4jhc6c7" || type == "SCBTGDT5515" || type == "SCBTGJHZY13"){
					window.location.href=encodeURI("${contextPath}/network/sczy_allot_list.htm");
				}else{
					window.location.href=encodeURI("${contextPath}/consu/consultant_import_list.htm");
				}
			}
		});
		var contextPath='${contextPath}';
		var _contextPath = '${staticServer}';
		function check(){
			var fileType = $("#upfile").val();
			//获取上传文件的文件名
			return fileType.split("\\")[2];
			//判断后缀是不是需要的文件类型
  	 		/*if(fileType != null && fileType != ""){
    			var start = fileType.lastIndexOf(".")+1;
				var length = fileType.length;
				var finalType = fileType.substring(start,length);
				if(finalType!="xls" && finalType!="xlsx"){
					alert("请上传(xls 或 xlsx)格式的文件！");
					return "false";
  				}else{
					//获取上传文件的文件名
					return fileType.split("\\")[2];
				}
			}*/
		}
		var getImport = function(){
			var url = $("#upfile").val();
			var type = $("#type").val();
			if(url == "" || type==""){
				alert("请选择来源渠道或选择上传的文件!");
				return;
			}
			var flag = check();
			if(flag == "false"){
				return;
			}
			$("#btn").attr("disabled", true);
			$('#forms').prop("action","consultant_import_go_jsp.htm?type="+type+"&url="+flag);
			$('#forms').submit();
		}
	</script>
</head>

<body>
	<div id="home_link">
		<ul>
			<li>竞思教育网络办公系统 v2.0 beta</li>
			<li>&gt;</li>
			<li>咨询师业务管理</li>
			<li>&gt;</li>
			<li class="current">客户资源导入</li>
		</ul>
	</div>
	<div id="container">
		<div id="title">客户资源导入</div><br/>
			<form method="post" id="forms" action=""  enctype="multipart/form-data">
			<div>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;选择文件来源：
				<select id="type">
					<option value="">请选择渠道</option>
					<option value="k4jmt5lbp8ne">400电话</option>
					<option value="baiduxunke">百度寻客</option>
					<option value="frvmppoifgmb">今日头条广告</option>
					<option value="lixianbao">离线宝</option>
					<option value="edhhjon7t6za">商桥留言</option>
					<option value="pmvk5vdc6ity">商务通未知</option>
					<!-- <option value="yunxiaoke">云销客</option> -->
					<option value="4D189169D77E">百度信息流</option>
					<option value="02FAC12A4746">百度糯米团购</option>
					<option value="ct5yq4jhc6c7">市场部推广(讲座)</option>
					<option value="SCBTGDT5515">市场部推广(地推)</option>
					<option value="SCBTGJHZY13">市场部推广(交换资源)</option>
					
				</select>&nbsp;
				<input type="file" name="file" id="upfile" />&nbsp;
				<input type="button" id="btn"  onclick="getImport()" value=" 确    定  "/>
			</div>
		</form>   
	</div>
</body>
<script>
	
</script>
</html>